#include "StdAfx.h"
#include "CmTreeData.h"


CCmTreeData::CCmTreeData(void)
{
	//static IpmiCmdItem g_UnitTreeNodeData	= {0, _T("CM")};

	m_nTreeNodeDataCount = 0;
	memset(m_pTreeNodeDatas, 0, sizeof(m_pTreeNodeDatas));
	//m_pTreeNodeDatas[m_nTreeNodeDataCount++] = &g_UnitTreeNodeData;
}


CCmTreeData::~CCmTreeData(void)
{
}

void CCmTreeData::AddTreeData(IpmiCmdItem treeNodeData[], int count)
{
	for(int i = 0; i < count; i++)
	{
		ASSERT(m_nTreeNodeDataCount < MAX_TREE_NODE_DATA);
		m_pTreeNodeDatas[m_nTreeNodeDataCount++] = &treeNodeData[i];
	}
}

IpmiCmdItem* CCmTreeData::FindTreeNodeData(WCHAR* pString)
{
	for(int i = 0; i < MAX_TREE_NODE_DATA; i++)
	{
		if(m_pTreeNodeDatas[i])
		{
			if(wcscmp(m_pTreeNodeDatas[i]->m_pName, pString) == 0)
			{
				return m_pTreeNodeDatas[i];
			}
		}
		else
		{
			break;
		}
	}
	return NULL;
}